package com.longjianghuasheng.logistics.business.release_record

import androidx.lifecycle.MutableLiveData
import com.longjianghuasheng.logistics.base.BaseMultiStateViewModel
import com.longjianghuasheng.logistics.data.model.bean.ApiResponseNoData
import com.longjianghuasheng.logistics.entity.RecordDetailResponse
import com.longjianghuasheng.logistics.entity.ReleaseDetailResponse
import com.longjianghuasheng.logistics.ext.commit2
import com.longjianghuasheng.logistics.network.apiService

class RecordDetailViewModel : BaseMultiStateViewModel() {

    var id = 0

    var isAgree = false

    val result by lazy {
        MutableLiveData<RecordDetailResponse>()
    }
    val notify by lazy {
        MutableLiveData<ApiResponseNoData>()
    }
    val deleteNotify by lazy {
        MutableLiveData<ApiResponseNoData>()
    }

    fun pre_order_show() {

        getData2({ apiService.pre_order_show(id) }, result)
    }


    fun agree() {

        commit2({ apiService.agree(id) }, notify)
    }


    fun pre_del() {

        commit2({ apiService.pre_del(id) }, notify)
    }
}